package data.component;

public class Opening extends Line {

    public String wallId;
    public String id;

    public Opening(String id, Double[] start, Double[] end, String wallId) {
        super(start, end, false);
        this.wallId = wallId;
        this.id = id;
    }

    public Opening(String id, Line line, String wallId) {
        super(line.start, line.end, false);
        this.id = id;
        this.wallId = wallId;
    }

    public String toString() {

        var shortId = wallId.length() > 5 ? wallId.substring(0, 5) : id;
        return String.format("start:[%d, %d]  end:[%d,%d] id:%s length:{%d}", start[0].intValue(),start[1].intValue(), end[0].intValue(), end[1].intValue(), shortId, Math.round(length));

    }
}
